import sys

from PyQt5 import QtGui
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtWidgets import QWidget, QApplication

from domain.note.noteDomain import NoteDomain
from domain.note.typeDomain import TypeDomain
from view.note.modules.ui_editNote import Ui_EditNote


class AddNote(Ui_EditNote, QWidget):
    ok = pyqtSignal()

    def __init__(self):
        super().__init__()
        self.setupUi(self)

        self.setWindowTitle('添加事件')

        self.noteDomain = NoteDomain()
        self.typeList = []

        self.editDate.dateChanged.connect(print)
        self.editStartTime.timeChanged.connect(print)
        self.editEndTime.timeChanged.connect(print)
        self.cmbType.currentIndexChanged.connect(print)
        self.btnSubmit.clicked.connect(lambda: self.handleSubmit())

    def setTypeList(self, typeList):
        self.typeList = typeList
        return self

    def handleSubmit(self):
        self.ok.emit()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    widget = AddNote()
    widget.show()
    app.exec_()











